<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Board game project: Game Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Board game project
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">A Board game software</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a>  </div>
  <div class="headertitle">
<div class="title">Game Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>A <a class="el" href="class_game.html" title="A Game class.">Game</a> class.  
 <a href="class_game.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_game_8h_source.html">Game.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for Game:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_game.png" usemap="#Game_map" alt=""/>
  <map id="Game_map" name="Game_map">
<area href="class_breakthrough_game.html" title="A BreakthroughGame class." alt="BreakthroughGame" shape="rect" coords="0,56,162,80"/>
<area href="class_breakthrough_game_smaller.html" title="A BreakthroughGameSmaller class." alt="BreakthroughGameSmaller" shape="rect" coords="172,56,334,80"/>
</map>
 </div></div>

<p><a href="class_game-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad59df6562a58a614fda24622d3715b65"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#ad59df6562a58a614fda24622d3715b65">Game</a> ()</td></tr>
<tr class="memdesc:ad59df6562a58a614fda24622d3715b65"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_game.html" title="A Game class.">Game</a> constructor.  <a href="#ad59df6562a58a614fda24622d3715b65"></a><br/></td></tr>
<tr class="memitem:a2e7c8cb10506b66e7d95a6efd21e778c"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a2e7c8cb10506b66e7d95a6efd21e778c">setBoard</a> ()=0</td></tr>
<tr class="memdesc:a2e7c8cb10506b66e7d95a6efd21e778c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set Board.  <a href="#a2e7c8cb10506b66e7d95a6efd21e778c"></a><br/></td></tr>
<tr class="memitem:add988158041df85337995e36f06756aa"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#add988158041df85337995e36f06756aa">start</a> ()=0</td></tr>
<tr class="memdesc:add988158041df85337995e36f06756aa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start game.  <a href="#add988158041df85337995e36f06756aa"></a><br/></td></tr>
<tr class="memitem:a6f3a33940524b6ba9d83f627ccb14bbf"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a6f3a33940524b6ba9d83f627ccb14bbf">init</a> ()</td></tr>
<tr class="memdesc:a6f3a33940524b6ba9d83f627ccb14bbf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Init game.  <a href="#a6f3a33940524b6ba9d83f627ccb14bbf"></a><br/></td></tr>
<tr class="memitem:a63c52c475debbced9961d7fd1e02366e"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a63c52c475debbced9961d7fd1e02366e">displayBoard</a> ()</td></tr>
<tr class="memdesc:a63c52c475debbced9961d7fd1e02366e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Display Board.  <a href="#a63c52c475debbced9961d7fd1e02366e"></a><br/></td></tr>
<tr class="memitem:acfbe6d42cabd6bf9820b8ccf13cda6cb"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#acfbe6d42cabd6bf9820b8ccf13cda6cb">movePiece</a> (int fromX, int fromY, int toX, int toY)=0</td></tr>
<tr class="memdesc:acfbe6d42cabd6bf9820b8ccf13cda6cb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move <a class="el" href="class_piece.html" title="A Piece class.">Piece</a>.  <a href="#acfbe6d42cabd6bf9820b8ccf13cda6cb"></a><br/></td></tr>
<tr class="memitem:a0d3ea96a10483373b8f150e6c310384b"><td class="memItemLeft" align="right" valign="top">std::vector&lt; <a class="el" href="struct_m_o_v_e.html">MOVE</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a0d3ea96a10483373b8f150e6c310384b">legal</a> ()</td></tr>
<tr class="memdesc:a0d3ea96a10483373b8f150e6c310384b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get legal moves.  <a href="#a0d3ea96a10483373b8f150e6c310384b"></a><br/></td></tr>
<tr class="memitem:a4d3236f38eb3209135cb978b60c24d31"><td class="memItemLeft" align="right" valign="top">virtual std::vector&lt; <a class="el" href="struct_m_o_v_e.html">MOVE</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a4d3236f38eb3209135cb978b60c24d31">legal</a> (GameBoard state)=0</td></tr>
<tr class="memdesc:a4d3236f38eb3209135cb978b60c24d31"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get legal moves.  <a href="#a4d3236f38eb3209135cb978b60c24d31"></a><br/></td></tr>
<tr class="memitem:a5892bcd9a13b8484f74ef317b484049c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a5892bcd9a13b8484f74ef317b484049c">isTerminal</a> ()</td></tr>
<tr class="memdesc:a5892bcd9a13b8484f74ef317b484049c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Is Terminal.  <a href="#a5892bcd9a13b8484f74ef317b484049c"></a><br/></td></tr>
<tr class="memitem:a9be0655102af94f1a37a7eaec1be36fc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a9be0655102af94f1a37a7eaec1be36fc">retract</a> ()</td></tr>
<tr class="memdesc:a9be0655102af94f1a37a7eaec1be36fc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retract.  <a href="#a9be0655102af94f1a37a7eaec1be36fc"></a><br/></td></tr>
<tr class="memitem:a9fb895bd0ce0684a2cf95d3d212487df"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a9fb895bd0ce0684a2cf95d3d212487df">evaluate</a> ()</td></tr>
<tr class="memdesc:a9fb895bd0ce0684a2cf95d3d212487df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Evaluate.  <a href="#a9fb895bd0ce0684a2cf95d3d212487df"></a><br/></td></tr>
<tr class="memitem:aafc474b47e358aa7d811f750591b8624"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#aafc474b47e358aa7d811f750591b8624">toggleDebug</a> ()</td></tr>
<tr class="memdesc:aafc474b47e358aa7d811f750591b8624"><td class="mdescLeft">&#160;</td><td class="mdescRight">Toggle Debug.  <a href="#aafc474b47e358aa7d811f750591b8624"></a><br/></td></tr>
<tr class="memitem:a7787bfc933ac23efb386abd7a948f2fe"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a7787bfc933ac23efb386abd7a948f2fe">getGameName</a> () const </td></tr>
<tr class="memdesc:a7787bfc933ac23efb386abd7a948f2fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get <a class="el" href="class_game.html" title="A Game class.">Game</a> Name.  <a href="#a7787bfc933ac23efb386abd7a948f2fe"></a><br/></td></tr>
<tr class="memitem:a764ec7d2e552fe43ee28b077a1552262"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a764ec7d2e552fe43ee28b077a1552262">getCurrentPlayer</a> () const </td></tr>
<tr class="memdesc:a764ec7d2e552fe43ee28b077a1552262"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get Current Player.  <a href="#a764ec7d2e552fe43ee28b077a1552262"></a><br/></td></tr>
<tr class="memitem:ab1a703bda25ab15b67e13e94d7d47437"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#ab1a703bda25ab15b67e13e94d7d47437">checkForWinner</a> ()</td></tr>
<tr class="memdesc:ab1a703bda25ab15b67e13e94d7d47437"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check for winner.  <a href="#ab1a703bda25ab15b67e13e94d7d47437"></a><br/></td></tr>
<tr class="memitem:a188c50dbdf4bdc68deadf87e5b8cf087"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a188c50dbdf4bdc68deadf87e5b8cf087">winningState</a> ()</td></tr>
<tr class="memdesc:a188c50dbdf4bdc68deadf87e5b8cf087"><td class="mdescLeft">&#160;</td><td class="mdescRight">Winning state.  <a href="#a188c50dbdf4bdc68deadf87e5b8cf087"></a><br/></td></tr>
<tr class="memitem:a4027d767c94b56e419913f8fbefbb596"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4027d767c94b56e419913f8fbefbb596"></a>
virtual int&#160;</td><td class="memItemRight" valign="bottom"><b>advancedEvaluate</b> ()=0</td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a8bdc3bec6db76d3cce902e762c168280"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a8bdc3bec6db76d3cce902e762c168280">setCurrentPlayer</a> (int player)</td></tr>
<tr class="memdesc:a8bdc3bec6db76d3cce902e762c168280"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set Current Player.  <a href="#a8bdc3bec6db76d3cce902e762c168280"></a><br/></td></tr>
<tr class="memitem:a055057cf58d0fed352a356ac49f0c6ca"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a055057cf58d0fed352a356ac49f0c6ca">countPieces</a> ()</td></tr>
<tr class="memdesc:a055057cf58d0fed352a356ac49f0c6ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Count Pieces.  <a href="#a055057cf58d0fed352a356ac49f0c6ca"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a4a268816bf99bfad4bb6e9f874b347c4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4a268816bf99bfad4bb6e9f874b347c4"></a>
GameBoard&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a4a268816bf99bfad4bb6e9f874b347c4">m_board</a></td></tr>
<tr class="memdesc:a4a268816bf99bfad4bb6e9f874b347c4"><td class="mdescLeft">&#160;</td><td class="mdescRight">The board as a vector of vectors of Pieces. <br/></td></tr>
<tr class="memitem:ae59bbb9ed560c60679f518ea41df3f90"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae59bbb9ed560c60679f518ea41df3f90"></a>
std::vector&lt; GameBoard &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#ae59bbb9ed560c60679f518ea41df3f90">m_stateHistory</a></td></tr>
<tr class="memdesc:ae59bbb9ed560c60679f518ea41df3f90"><td class="mdescLeft">&#160;</td><td class="mdescRight">The state history as a vector of boards. <br/></td></tr>
<tr class="memitem:a8604ec6203f31ac5603bd597f49834d0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8604ec6203f31ac5603bd597f49834d0"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a8604ec6203f31ac5603bd597f49834d0">m_debug</a></td></tr>
<tr class="memdesc:a8604ec6203f31ac5603bd597f49834d0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Debug mode on/off. <br/></td></tr>
<tr class="memitem:a72aa3904f6cc0b9adb37b228e5bd41e4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a72aa3904f6cc0b9adb37b228e5bd41e4"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a72aa3904f6cc0b9adb37b228e5bd41e4">m_currentPlayer</a></td></tr>
<tr class="memdesc:a72aa3904f6cc0b9adb37b228e5bd41e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">The current player. <br/></td></tr>
<tr class="memitem:a3e45a5bc0402d7f2688141cd22151dfe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3e45a5bc0402d7f2688141cd22151dfe"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a3e45a5bc0402d7f2688141cd22151dfe">m_name</a></td></tr>
<tr class="memdesc:a3e45a5bc0402d7f2688141cd22151dfe"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_game.html" title="A Game class.">Game</a> name. <br/></td></tr>
<tr class="memitem:ad415cbb7ee6e23dd6a141d9221cc308a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad415cbb7ee6e23dd6a141d9221cc308a"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#ad415cbb7ee6e23dd6a141d9221cc308a">numPiecesP1</a></td></tr>
<tr class="memdesc:ad415cbb7ee6e23dd6a141d9221cc308a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Player 1 piece count. <br/></td></tr>
<tr class="memitem:a8a6e2dfc4d3b47bfe9ce3eb8ae983abc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8a6e2dfc4d3b47bfe9ce3eb8ae983abc"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a8a6e2dfc4d3b47bfe9ce3eb8ae983abc">numPiecesP2</a></td></tr>
<tr class="memdesc:a8a6e2dfc4d3b47bfe9ce3eb8ae983abc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Player 2 piece count. <br/></td></tr>
<tr class="memitem:a9ec80071a59b011289d9fe4839e82b20"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9ec80071a59b011289d9fe4839e82b20"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_game.html#a9ec80071a59b011289d9fe4839e82b20">m_moveCount</a></td></tr>
<tr class="memdesc:a9ec80071a59b011289d9fe4839e82b20"><td class="mdescLeft">&#160;</td><td class="mdescRight">Total move count. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>An abstract <a class="el" href="class_game.html" title="A Game class.">Game</a> class that defines a board game </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ad59df6562a58a614fda24622d3715b65"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_game.html#ad59df6562a58a614fda24622d3715b65">Game::Game</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Constructs a game. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ab1a703bda25ab15b67e13e94d7d47437"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_game.html#ab1a703bda25ab15b67e13e94d7d47437">Game::checkForWinner</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Checks if the game has a winner. Starts a new game if game is over. </p>

</div>
</div>
<a class="anchor" id="a055057cf58d0fed352a356ac49f0c6ca"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_game.html#a055057cf58d0fed352a356ac49f0c6ca">Game::countPieces</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Counts the pieces of both players. Changes numPiecesP1 and numPiecesP2 accordingly. </p>

</div>
</div>
<a class="anchor" id="a63c52c475debbced9961d7fd1e02366e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_game.html#a63c52c475debbced9961d7fd1e02366e">Game::displayBoard</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Displays the board, piece count and current player. </p>

<p>Reimplemented in <a class="el" href="class_breakthrough_game.html#a235177e42711a4aa2c90ac630def142f">BreakthroughGame</a>, and <a class="el" href="class_breakthrough_game_smaller.html#a6d1f95494ce8e2df7d32e3035acb9f6c">BreakthroughGameSmaller</a>.</p>

</div>
</div>
<a class="anchor" id="a9fb895bd0ce0684a2cf95d3d212487df"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_game.html#a9fb895bd0ce0684a2cf95d3d212487df">Game::evaluate</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The evaluation value of the current board state using current difficulty level. </p>
<dl class="section return"><dt>Returns:</dt><dd>The evaluation value. </dd></dl>

</div>
</div>
<a class="anchor" id="a764ec7d2e552fe43ee28b077a1552262"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_game.html#a764ec7d2e552fe43ee28b077a1552262">Game::getCurrentPlayer</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Gets the current player. </p>
<dl class="section return"><dt>Returns:</dt><dd>The current player as 0 or 1. </dd></dl>

</div>
</div>
<a class="anchor" id="a7787bfc933ac23efb386abd7a948f2fe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">string <a class="el" href="class_game.html#a7787bfc933ac23efb386abd7a948f2fe">Game::getGameName</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Gets the game name. </p>
<dl class="section return"><dt>Returns:</dt><dd>The game name. </dd></dl>

</div>
</div>
<a class="anchor" id="a6f3a33940524b6ba9d83f627ccb14bbf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_game.html#a6f3a33940524b6ba9d83f627ccb14bbf">Game::init</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Initializes the basic variables of the game. Sets the board, currentPlayer, moveCount, piece count, adds the initial state and sets debugging to off. </p>

</div>
</div>
<a class="anchor" id="a5892bcd9a13b8484f74ef317b484049c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="class_game.html#a5892bcd9a13b8484f74ef317b484049c">Game::isTerminal</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns true if current state is a terminal state. </p>
<dl class="section return"><dt>Returns:</dt><dd>True if terminal state, else false. </dd></dl>

</div>
</div>
<a class="anchor" id="a0d3ea96a10483373b8f150e6c310384b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">vector&lt; <a class="el" href="struct_m_o_v_e.html">MOVE</a> &gt; <a class="el" href="class_game.html#a0d3ea96a10483373b8f150e6c310384b">Game::legal</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns vector of legal MOVEs </p>
<dl class="section return"><dt>Returns:</dt><dd>Vector of MOVEs </dd></dl>

</div>
</div>
<a class="anchor" id="a4d3236f38eb3209135cb978b60c24d31"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual std::vector&lt;<a class="el" href="struct_m_o_v_e.html">MOVE</a>&gt; <a class="el" href="class_game.html#a0d3ea96a10483373b8f150e6c310384b">Game::legal</a> </td>
          <td>(</td>
          <td class="paramtype">GameBoard&#160;</td>
          <td class="paramname"><em>state</em></td><td>)</td>
          <td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>A pure virtual function. Returns vector of legal MOVEs for the given state. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">state</td><td>The state to find legal moves for. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>Vector of MOVEs </dd></dl>

<p>Implemented in <a class="el" href="class_breakthrough_game.html#a7849c63ba5de5b52fcb273a5f4a38ebd">BreakthroughGame</a>, and <a class="el" href="class_breakthrough_game_smaller.html#a50659c96ab862311624124476e4f52fe">BreakthroughGameSmaller</a>.</p>

</div>
</div>
<a class="anchor" id="acfbe6d42cabd6bf9820b8ccf13cda6cb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void <a class="el" href="class_game.html#acfbe6d42cabd6bf9820b8ccf13cda6cb">Game::movePiece</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fromX</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fromY</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>toX</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>toY</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Pure virtual function. Moves the piece from (fromX,fromY) to (toX,toY)</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">fromX,fromY</td><td>The source coordinate. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">toX,toY</td><td>The destination coordinate. </td></tr>
  </table>
  </dd>
</dl>

<p>Implemented in <a class="el" href="class_breakthrough_game.html#a26d176fd3278fed27908822a42b10a4f">BreakthroughGame</a>, and <a class="el" href="class_breakthrough_game_smaller.html#ab39cc839a9e068d6b712727e64fab6b1">BreakthroughGameSmaller</a>.</p>

</div>
</div>
<a class="anchor" id="a9be0655102af94f1a37a7eaec1be36fc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_game.html#a9be0655102af94f1a37a7eaec1be36fc">Game::retract</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Retracts the last move by erasing last board object from the state history. </p>

</div>
</div>
<a class="anchor" id="a2e7c8cb10506b66e7d95a6efd21e778c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void <a class="el" href="class_game.html#a2e7c8cb10506b66e7d95a6efd21e778c">Game::setBoard</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Pure virtual function. Sets the board for the game. </p>

<p>Implemented in <a class="el" href="class_breakthrough_game.html#ade5f4effccbb408e7545d93deed918c0">BreakthroughGame</a>, and <a class="el" href="class_breakthrough_game_smaller.html#a9971fe6cc105cae3b62c7138cac2e231">BreakthroughGameSmaller</a>.</p>

</div>
</div>
<a class="anchor" id="a8bdc3bec6db76d3cce902e762c168280"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_game.html#a8bdc3bec6db76d3cce902e762c168280">Game::setCurrentPlayer</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>player</em></td><td>)</td>
          <td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sets the current player. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">player</td><td>The current player. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="add988158041df85337995e36f06756aa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void <a class="el" href="class_game.html#add988158041df85337995e36f06756aa">Game::start</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Pure virtual function. Starts the game. </p>

<p>Implemented in <a class="el" href="class_breakthrough_game.html#af0267e49d572db8f52885870cca25ea5">BreakthroughGame</a>, and <a class="el" href="class_breakthrough_game_smaller.html#afaf83b059166be9faf3597abbcbdbda7">BreakthroughGameSmaller</a>.</p>

</div>
</div>
<a class="anchor" id="aafc474b47e358aa7d811f750591b8624"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="class_game.html#aafc474b47e358aa7d811f750591b8624">Game::toggleDebug</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Toggles debug mode on or off. </p>

</div>
</div>
<a class="anchor" id="a188c50dbdf4bdc68deadf87e5b8cf087"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_game.html#a188c50dbdf4bdc68deadf87e5b8cf087">Game::winningState</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Checks if the game is a tie. </p>
<dl class="section return"><dt>Returns:</dt><dd>2 if the game is a tie, else -1. </dd></dl>

<p>Reimplemented in <a class="el" href="class_breakthrough_game.html#a04c7358b62c4202e5b9cb44c42f2a3de">BreakthroughGame</a>, and <a class="el" href="class_breakthrough_game_smaller.html#a9ac1fc9672cfa26fbb9075ad0aab5721">BreakthroughGameSmaller</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>include/<a class="el" href="_game_8h_source.html">Game.h</a></li>
<li>src/Game.cpp</li>
</ul>
</div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Sat May 12 2012 03:23:28 for Board game project by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.0
</small></address>

</body>
</html>
